<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../core/include.inc.jsp"%>

<style>
    .pageFormContent p {
        width: 90%;
    }
</style>

<div class="pageContent">
    <form method="post" action="user_edit" class="pageForm required-validate"
          onsubmit="return validateCallback(this, dialogAjaxDone)">

        <div class="pageFormContent nowrap" layoutH="57">

            <input type="hidden" name="id" readonly="readonly" value="${user.id}" />

            <p>
                <label>用户名</label>
                <input type="text" name="userName" readonly="readonly" value="${user.userName}" />
            </p>

            <p>
                <label>新密码</label>
                <input type="password" name="pwd" id="input_pwd"
                       class="alphanumeric" minlength="6" maxlength="20" />
            </p>

            <p>
                <label>确认新密码</label>
                <input type="password" name="cpwd"
                       class="alphanumeric" equalto="#input_pwd" />
            </p>

            <p>
                <label>联系人</label>
                <input type="text" name="personName"
                       class="required" minlength="2" maxlength="20" value="${user.personName}" />
            </p>

            <p>
                <label>手机号</label>
                <input type="text" name="mobile"
                       class="required phone" maxlength="20" value="${user.mobile}" />
            </p>

            <p>
                <label>身份</label>
                <select name="roleId" class="combox">
                    <c:forEach var="role" items="${roleList}">
                        <option value="${role.id}" <c:if test="${role.id == user.roleId}">selected="selected"</c:if>>
                                ${role.roleName}
                        </option>
                    </c:forEach>
                </select>
            </p>

            <p>
                <label>状态</label>
                <input type="radio" name="isAvailable" value="true"  <c:if test="${user.isAvailable}" >checked="checked"</c:if>>启用</input>
                <input type="radio" name="isAvailable" value="false" <c:if test="${!user.isAvailable}">checked="checked"</c:if>>禁用</input>
            </p>

        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent" style="text-align: center;">
                            <button type="submit">保存</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>